<template>
    <div id="app">
        <sph-header></sph-header>
        <router-view></router-view>
        <!-- hiddenFooter为true时,则隐藏footer -->
        <sph-footer v-show="!$route.meta.hiddenFooter"></sph-footer>
    </div>
</template>

<script>
    import Header from 'components/header/Header'
    import Footer from 'components/footer/Footer'
    import {
        mapActions
    } from 'vuex';
    export default {
        name: 'App',
        components: {
            'sph-header': Header,
            'sph-footer': Footer,
        },
        methods: {
            ...mapActions(['getCategoryList', 'getBanners', 'getFloor','getUserInfo','logout']),
            //  getCategoryList() {
            //    return this.$store.dispatch('getCategoryList')
            // }
        },
        async created() {
            //获取三级分类数据
            await this.getCategoryList()
            // console.log(this.getCategoryList())
            //获取轮播图数据
            await this.getBanners()
            //获取楼层数据
            await this.getFloor()
            // const data = await axios.post('/mock/pagination',{currentPage:2, pageSize:20})
            
        },
        
    }
</script>

<style>

</style>
